﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;
using System.Data;

namespace BLL
{
    public class B_Khach
    {
        public M_Khach GetByPK_KhachID(int KhachID)
        {
            return (new D_Khach()).GetbyPK_KhachID(KhachID);
        }

        public DataTable GetAll()
        {
            return (new D_Khach()).GetAll();
        }

        public void Insert(M_Khach M_Khach)
        {
            (new D_Khach()).Insert(M_Khach);
        }

        public void Update(M_Khach M_Khach)
        {
            (new D_Khach()).Update(M_Khach);
        }

        public void Delete(int KhachID)
        {
            if (KhachID <= 0)
                throw new Exception("Không hợp lệ! Vui lòng thử lại sau!");

            new D_Khach().Delete(KhachID);
        }
    }
}
